package objectio;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.ObjectOutputStream;
import java.util.LinkedList;
import java.util.Queue;

public class Main {

	public static boolean flag = false;
	
	public static void main(String[] args) throws Exception {
		Queue<Person> que = new LinkedList<Person>();
		BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("person.data")));
		ObjectOutputStream objectOutputStream = new  ObjectOutputStream(new FileOutputStream("person_copy2.data"));

		
		new Thread(new Producer(que,reader)).start();
		new Thread(new Consumer(que, objectOutputStream)).start();
		
		
	}
}
